﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Manas.DynamicDeepZoom.Web
{
    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Tile",
                "{controller}/{action}/{level}/{x}/{y}",
                new { controller = "Tiles", action = "Tile", level = 1, x = 0, y = 0 }
            );

            routes.MapRoute(
                "Level",
                "{controller}/{action}/{level}",
                new { controller = "Tiles", action = "Level", level = 1 }
            );

            routes.MapRoute("Default"
                , "{controller}/{action}"
                , new { controller = "Tiles", action = "Squares" }); 

        }

        protected void Application_Start()
        {
            RegisterRoutes(RouteTable.Routes);
        }
    }
}